// 引入axios对象
import request from '@/utils/request'
//定义可以枚举的api

enum TrademarkApi {
  // 获取品牌数据的api
  getTrademarkInfoApi='/admin/product/baseTrademark',
  // 添加品牌数据的api
  svaeTrademarkInfoApi='/admin/product/baseTrademark/save',
  //更改
  changeTrademarkInfoApi='/admin/product/baseTrademark/update',
  //删除品牌数据
  delteTrademarkInfoApi='/admin/product/baseTrademark/remove'

}

// 导入类型约束
import type {TrademarkListDataModel,TrademarkModel }  from "@/api/product/model/trademarkModel"
// 定义一个以获取品牌数据的接口函数
export const  reqGetTrademarkInfoData=
(page:number,limit:number)=>request.get <any,TrademarkListDataModel>(`${TrademarkApi.getTrademarkInfoApi}/${page}/${limit}`)
// 添加品牌数据的接口方法
export const reqSaveTrademarkInfo=(trademark:TrademarkModel)=>request.post(TrademarkApi.svaeTrademarkInfoApi,trademark)
//删除品牌数据
export const reqDelTrademarkInfo=(id:number)=>request.delete(`/admin/product/baseTrademark/remove/${id}`)
// 更改品牌数据
export const UpDateTrademarkInfo=(trademark:TrademarkModel)=>request.put('/admin/product/baseTrademark/update',trademark)